package com.chs.recoginition.core.exception;

import lombok.Getter;

/**
 * 应用异常
 */
@Getter
public class ApplicationException extends RuntimeException {
    private String errorCode;
    private String errorMessage;

    public ApplicationException(ApplicationExceptionMessage constant) {
        super("[" + constant.getErrorCode() + "]" + constant.getErrorMessage());
        this.errorCode = constant.getErrorCode();
        this.errorMessage = constant.getErrorMessage();
    }

    public ApplicationException(ApplicationExceptionMessage constant, String errorMessage) {
        super("[" + constant.getErrorCode() + "]" + errorMessage);
        this.errorCode = constant.getErrorCode();
        this.errorMessage = errorMessage;
    }

    public ApplicationException(String errorCode, String errorMessage) {
        super("[" + errorCode + "]" + errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }
}
